/**
 * 
 */
package com.antilia.infomaresme.pages.alert;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.ResourceModel;

import com.antilia.infomaresme.link.JQIcon;
import com.antilia.infomaresme.link.JqAjaxLink;

/**
 * @author Ernesto
 *
 */
public abstract class ActionsPanel extends Panel {

	private static final long serialVersionUID = 1L;

	/**
	 * @param id
	 */
	public ActionsPanel(String id) {
		super(id);
		
		JqAjaxLink edit = new JqAjaxLink("edit", JQIcon.ui_icon_document, new ResourceModel("actions.edit")) {
			
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick(AjaxRequestTarget target) {
				onEdit(target);
			}
		};
		add(edit);
		
		JqAjaxLink delete = new JqAjaxLink("delete", JQIcon.ui_icon_close, new ResourceModel("actions.delete")) {
			
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick(AjaxRequestTarget target) {
				onDelete(target);
			}
		};
		add(delete);
	}
	
	protected abstract void onEdit(AjaxRequestTarget target);
	
	protected abstract void onDelete(AjaxRequestTarget target);
	
}
